package model

import (
	"context"
	"service/ctrl"
	"service/model/mod"

	gpb "gitee.com/cloudapex/protos/pro_know/pb"
	"google.golang.org/grpc"
)

var ProClass proclass

func init() {
	ctrl.GCon.RegistClienter(mod.GCONN_KB_PRO, func(c *grpc.ClientConn) {
		ProClass.cli = gpb.NewUserClassClient(c)
	})
}

type proclass struct {
	cli gpb.UserClassClient
}

func (this *proclass) GetProClassList(ctx context.Context, in *gpb.ProListReq) (*gpb.ProClassListRes, error) {
	return this.cli.GetProClassList(ctx, in)
}

//获取班型课程
func (this *proclass) ClassCourList(ctx context.Context, in *gpb.ClassCourReq) (*gpb.ClassCourListRes, error) {
	return this.cli.ClassCourList(ctx, in)
}

//获取项目列表
func (this *proclass) GetProList(ctx context.Context, in *gpb.ProLReq) (*gpb.ProListRes, error) {
	return this.cli.GetProList(ctx, in)
}

// 获取班型下科目
func (this *proclass) ClassKemuList(ctx context.Context, in *gpb.ClassKemuReq) (*gpb.ClassKemuListRes, error) {
	return this.cli.ClassKemuList(ctx, in)
}

// 获取班型下科目
func (this *proclass) UpdateClassCount(ctx context.Context, in *gpb.ClassReq) (*gpb.ClassUpRes, error) {
	return this.cli.UpdateClass(ctx, in)
}
